package funcs

import (
	"fmt"
)

func AMutiResultFunc() (string, int) {
	return "这是字符串", 18
}

func DeferDemo() (result int) {
	resul := 1
	defer func() {
		fmt.Println("这是defer打印", resul)
		resul += 1
	}()
	return resul + 1
}
func DeferDemo2() (result int) {
	// result := 2 // 错误的,短变量声明必须要有新的变量产生,但是因为已经有命名返回值了
	result = 2
	defer func() {
		fmt.Println("这是defer打印", result)
		result += 2
	}()
	return result + 2
}
